You need two variables to implement a basic calculator: an accumulator to store the value of the first operand when an operation button is pressed, and a variable to store the operation itself. 要实现基本的计算器功能,需要添加两个变量:一个累加器,用来在操作按钮按下时存储第一个操作数的值;一个变量用来存储操作本身。